import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch_ros.actions import Node

def generate_launch_description():
    ld = LaunchDescription()

    config = os.path.join(
        get_package_share_directory('ros1_bridge'),
        'set_sim.yaml'
        )
    # ld = []
    node1=Node(
        package = 'ros1_bridge',
        name = 'image_bridge_2_to_1_buav_3',
        executable = 'image_bridge_2_to_1',
        output = 'screen',
        # respawn = True,
        parameters = [config,
                    {"vehicle_name":'buav_3'}],
        # arguments = ['buav_3'],
    )
    node2=Node(
        package = 'ros1_bridge',
        name = 'pointcloud_bridge_2_to_1_buav_3',
        executable = 'pointcloud_bridge_2_to_1',
        # output = 'screen',
        # respawn = True,
        parameters = [config,
                    {"vehicle_name":'buav_3'}],
        # arguments = ['buav_3'],
    )

    ld.add_action(node1)
    ld.add_action(node2)
    return ld
